import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/analysis/get_company_device_list_entity.dart';

GetCompanyDeviceListEntity $GetCompanyDeviceListEntityFromJson(Map<String, dynamic> json) {
  final GetCompanyDeviceListEntity getCompanyDeviceListEntity = GetCompanyDeviceListEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    getCompanyDeviceListEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    getCompanyDeviceListEntity.companyId = companyId;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    getCompanyDeviceListEntity.companyName = companyName;
  }
  final int? systemId = jsonConvert.convert<int>(json['systemId']);
  if (systemId != null) {
    getCompanyDeviceListEntity.systemId = systemId;
  }
  final String? systemName = jsonConvert.convert<String>(json['systemName']);
  if (systemName != null) {
    getCompanyDeviceListEntity.systemName = systemName;
  }
  final int? systemType = jsonConvert.convert<int>(json['systemType']);
  if (systemType != null) {
    getCompanyDeviceListEntity.systemType = systemType;
  }
  final String? monitorCode = jsonConvert.convert<String>(json['monitorCode']);
  if (monitorCode != null) {
    getCompanyDeviceListEntity.monitorCode = monitorCode;
  }
  final String? monitorName = jsonConvert.convert<String>(json['monitorName']);
  if (monitorName != null) {
    getCompanyDeviceListEntity.monitorName = monitorName;
  }
  final String? deviceCode = jsonConvert.convert<String>(json['deviceCode']);
  if (deviceCode != null) {
    getCompanyDeviceListEntity.deviceCode = deviceCode;
  }
  final String? deviceName = jsonConvert.convert<String>(json['deviceName']);
  if (deviceName != null) {
    getCompanyDeviceListEntity.deviceName = deviceName;
  }
  final int? createTime = jsonConvert.convert<int>(json['createTime']);
  if (createTime != null) {
    getCompanyDeviceListEntity.createTime = createTime;
  }
  final int? deviceStatus = jsonConvert.convert<int>(json['deviceStatus']);
  if (deviceStatus != null) {
    getCompanyDeviceListEntity.deviceStatus = deviceStatus;
  }
  final dynamic systemCode = json['systemCode'];
  if (systemCode != null) {
    getCompanyDeviceListEntity.systemCode = systemCode;
  }
  final int? onlineStatus = jsonConvert.convert<int>(json['onlineStatus']);
  if (onlineStatus != null) {
    getCompanyDeviceListEntity.onlineStatus = onlineStatus;
  }
  return getCompanyDeviceListEntity;
}

Map<String, dynamic> $GetCompanyDeviceListEntityToJson(GetCompanyDeviceListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['companyName'] = entity.companyName;
  data['systemId'] = entity.systemId;
  data['systemName'] = entity.systemName;
  data['systemType'] = entity.systemType;
  data['monitorCode'] = entity.monitorCode;
  data['monitorName'] = entity.monitorName;
  data['deviceCode'] = entity.deviceCode;
  data['deviceName'] = entity.deviceName;
  data['createTime'] = entity.createTime;
  data['deviceStatus'] = entity.deviceStatus;
  data['systemCode'] = entity.systemCode;
  data['onlineStatus'] = entity.onlineStatus;
  return data;
}

extension GetCompanyDeviceListEntityExtension on GetCompanyDeviceListEntity {
  GetCompanyDeviceListEntity copyWith({
    int? id,
    int? companyId,
    String? companyName,
    int? systemId,
    String? systemName,
    int? systemType,
    String? monitorCode,
    String? monitorName,
    String? deviceCode,
    String? deviceName,
    int? createTime,
    int? deviceStatus,
    dynamic systemCode,
    int? onlineStatus,
  }) {
    return GetCompanyDeviceListEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..companyName = companyName ?? this.companyName
      ..systemId = systemId ?? this.systemId
      ..systemName = systemName ?? this.systemName
      ..systemType = systemType ?? this.systemType
      ..monitorCode = monitorCode ?? this.monitorCode
      ..monitorName = monitorName ?? this.monitorName
      ..deviceCode = deviceCode ?? this.deviceCode
      ..deviceName = deviceName ?? this.deviceName
      ..createTime = createTime ?? this.createTime
      ..deviceStatus = deviceStatus ?? this.deviceStatus
      ..systemCode = systemCode ?? this.systemCode
      ..onlineStatus = onlineStatus ?? this.onlineStatus;
  }
}